package com.keon.jianbao.ui.fragment;

import android.view.View;
import android.widget.AdapterView;

import com.keon.jianbao.adapter.OrderListAdapter;
import com.keon.jianbao.api.ApiHttpClient;
import com.keon.jianbao.base.BaseActivity;
import com.keon.jianbao.base.BaseListAdapter;
import com.keon.jianbao.base.BaseListFragment;
import com.keon.jianbao.bean.ListEntity;
import com.keon.jianbao.bean.OrderList;
import com.keon.jianbao.ui.activity.OrderDetailActivity;

/**
 * Created by keon on 2015/9/9.
 */
public class OrderListFragemnt extends BaseListFragment {

    @Override
    protected void sendRequestData() {
        ApiHttpClient.g("http://www.baidu.com", mHandler);
    }

    @Override
    protected ListEntity parseList(String reponseData) {

        OrderList orderList = new OrderList(reponseData);

        return orderList;
    }

    @Override
    protected BaseListAdapter getListAdapter() {
        return new OrderListAdapter();
    }

    @Override
    public void initData() {

    }

    @Override
    public void onClick(View view) {

    }

    @Override
    protected String getCacheKeyPrefix() {
        return "ORDERLIST";
    }

    @Override
    public void initView(View view) {
        super.initView(view);
        mListView.setDividerHeight(20);
    }

    @Override
    public void onItemClick(AdapterView parent, View view, int position, long id) {
//        super.onItemClick(parent, view, position, id);
        BaseActivity ba = (BaseActivity) getActivity();
        ba.jump(OrderDetailActivity.class);
    }
}
